#ifndef CALCDISTANCE_H
#define CALCDISTANCE_H

#include <QThread>
#include <opencv2/opencv.hpp>
#include <QMap>
#include "camera_parameters.h"
#include "distance.h"
#include "pose_correct.h"

class CalcDistance : public QThread
{
	Q_OBJECT

public:
	CalcDistance(QObject *parent=nullptr);
	~CalcDistance();

	void setImage(cv::Mat& image);
	void setCameraParameter(const QString& distanceFilename, const QString& calibFilenname);
	void setPoseCorrect(PoseCorrect* poseCorrect);
	void setDistance(Distance* distance);

	cv::Mat resultImage;

signals:
	void processed(double);

protected:
	virtual void run() override;

private:
	cv::Mat image;
	CameraParameters cameraParameter;
	PoseCorrect* poseCorrect;
	QMap<QString, double> parameters;
	Distance* distance;
};

#endif
